import request from '../../utils/request.js'
export default {
	state: {
		initData: {}
	},
	actions: {
		async getInitData({commit}) {
			const result = await request('/initData');
			commit('INITDATA', result.datas);
		}
	},
	mutations: {
		INITDATA(state, value){
			state.initData = value;
		}
	},
	getters: {
		// 导航
		kingKongList(state){
			return state.initData.kingKongModule ? state.initData.kingKongModule.kingKongList : [];
		},
		// 政策信息
		policyDescList(state){
			return state.initData.policyDescList ? state.initData.policyDescList : [];
		},
		// 首页的分类信息
		categoryModule(state){
			return state.initData.categoryModule ? state.initData.categoryModule : [];
		}
	}
}
